﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;

namespace Music.Utility.Ioc {

    /// <summary>
    /// IocManager
    /// </summary>
    public class IocManager {

        /// <summary>
        /// SetProvider
        /// </summary>
        /// <param name="provider"></param>
        /// <returns></returns>
        [MethodImpl(MethodImplOptions.Synchronized)]
        public static IIocFactory SetProvider(IIocFactory provider) {
            if (Current == null) {
                Current = provider;
            }
            return Current;
        }

        /// <summary>
        /// Current
        /// </summary>
        public static IIocFactory Current { get; private set; }
    }
}
